package server;

import com.lagou.http.HttpServlet;

import java.util.HashMap;
import java.util.Map;

/**
 * @author stevejson
 */
public class Mapper {

        /**
         *  demo01  对应的url  servlet
         */
        private Map<String, Map<String, HttpServlet>> content2Wrapper = new HashMap<>();

        /**
         * demo01  对应的绝对路径
         */
        private Map<String, String> resourcesMap = new HashMap<>();

        public void putStaticResources(String key, String value) {
            resourcesMap.put("/" + key, value);
        }

        public void putServletMap(String key, Map<String, HttpServlet> value) {
            content2Wrapper.put("/" + key, value);
        }

        public Map<String, HttpServlet> getServletMap(String key) {
            return content2Wrapper.get(key);
        }

        public String getStaticPath(String key) {
            return resourcesMap.get(key);
        }
}
